﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QThread>
#include <QSettings>
#include "customzoomchart.h"
#include "configuredialog.h"
#include "chartconfig.h"
#include "softinfodialog.h"


QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_action_open_triggered();

    void on_action_remove_triggered();

    void on_action_exit_triggered();

    void on_action_config_triggered();

    void on_action_screeshot_triggered();

    void on_action_info_triggered();

private:

    QThread m_dataThread;
    QVector<QStringList> m_seriesData;
    CustomZoomChart *m_myChart;
    ConfigureDialog *m_configDialog;
    SoftInfoDialog *m_infoDialog;
    ConfigStruct m_config;
    ChartConfig m_chartConfigFile;
    QString m_originFileName;

private:

    void sysInit();
    QVector<QStringList> getSeriesData(QString& filePath); //convert CSV file to basic data;
    bool judgeSeriesData();
    void getConfig();
    void setConfig();
    void screenShot();

public slots:

    void receiveConfigure();


signals:
    void passDataFileName(QString& fileName);


private:
    Ui::MainWindow *ui;

};
#endif // MAINWINDOW_H
